package com.example.business.controller.admin;

import com.example.business.controller.base.ProductBaseController;
import com.example.common.response.R;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;
import com.example.business.request.ProductRequest;
import java.util.List;

@RestController
@RequestMapping("admin/product")
public class ProductAdminController extends ProductBaseController {
    @PostMapping("save")
    public R<Object> save(@Valid @RequestBody ProductRequest request) {
        productService.save(request);
        return R.ok();
    }

    @DeleteMapping("delete")
    public R<Integer> delete(@RequestBody List<Long> ids) {
        int result = productService.deleteBatch(ids);
        return R.ok(result);
    }
}
